package cn.itcast.crm.service;

import java.util.List;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;

import cn.itcast.crm.domain.Customer;

/**
 * 客户业务接口层
 * 
 * @author 王文杰
 * @version 1.0, 2017-9-8 18:25:53
 */
public interface CustomerService {

	/**
	 * 查询未关联的客户列表
	 * @return customer集合
	 */
	@Path("/noassociationcustomers")
	@GET
	@Produces({"application/xml","application/json"})
	public List<Customer> findNoAssociationCustomers();
	
	/**
	 * 查询已关联到指定定区的客户列表
	 * @return customer集合
	 */
	@Path("/asassociationfixedareacustomers/{fixedareaid}")
	@GET
	@Produces({"application/xml","application/json"})
	public List<Customer> findHasAssociationFixedAreaCustomers( @PathParam("fixedareaid") String fixedAreaId);
	
	/**
	 * 将客户关联到定区上
	 * @return customer集合
	 */
	@Path("/associationcustomerstofixedarea")
	@PUT
	public void associationCustomersToFixedArea(@QueryParam("customerIdStr") String customerIdStr,@QueryParam("fixedAreaId") String fixedAreaId);
	
	/**
	 * 保存用户信息的方法
	 * 
	 * @param customer
	 */
	@Path("/customer")
	@POST
	@Consumes({"application/xml","application/json"})
	public void register(Customer customer);
	
	/**
	 * 查询customer对象的方法
	 * 
	 * @param telephone
	 * @return
	 */
	@Path("/customer/telephone/{telephone}")
	@GET
	@Consumes({"application/xml","application/json"})
	public Customer findByTelephone(@PathParam("telephone") String telephone);

	/***
	 * 修改邮箱认证类型
	 * 
	 * @param telephone
	 */
	@Path("/customer/updatetype/{telephone}")
	@GET
	public void updateType(@PathParam("telephone") String telephone);
}
